﻿using CID.Domain.Development;
using NailsFramework.Persistence;

namespace CID.Domain.Infrastructure
{
    public class Package : Model<Package>, IPackage
    {
        public virtual int Id { get; private set; }
        public virtual IPackageType Type { get; private set; }
        public virtual IVersion Version { get; private set; }
        public virtual byte[] Content { get; private set; }
        public virtual string Comment { get; private set; }

        protected Package()
        { 
        }

        internal Package(IPackageType type, IVersion version, byte[] content, string comment) : this()
        {
            Type = type;
            Version = version;
            Content = content;
            Comment = comment;
            Version.AddPackage(this);
        }
    }
}
